package com.electronsys.emp.dao.impl;


import java.util.List;
import java.util.Map;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.electronsys.emp.dao.LogonDao;
import com.electronsys.pojo.Employee;


public class LogonDaoImpl extends HibernateDaoSupport implements LogonDao {
    
	
	@SuppressWarnings({ "unchecked", "finally" })
	public boolean login(String username,String password) {
		
		   boolean b = false;
            try{
				String hql = "from Employee where emp_id=? and emp_passwd=? ";
				List<Employee> list =this.getHibernateTemplate().find(hql, username,password); 
				if(list.isEmpty()){
					b = false;
				}else{
					b = true;
				}
			}catch(Exception e){
				b = false;
				e.printStackTrace();
			}
			return b;
			
		}
	}

